﻿//this controller has served as example in a presentation.
//it shows that you can use even anonymous classes, actually these maps fantastic with json

using System.Web.Http;
using System.Net;
using System.Net.Http;
using DotNetNuke.Web.Api;

namespace dnneurope.portalgroups.services
{
    [AllowAnonymous]
    public class SpikeController : DnnApiController
    {
        public HttpResponseMessage Get()
        {
            var model = new
                {
                    content = "with WebAPi",
                    cities = new[] { new { name = "Rom" }, new { name = "Athen" }, new { name = "Barcelona" } }
                };
            return Request.CreateResponse(HttpStatusCode.OK, model);
        }
    }
}